package com.hpeu_01.day0115.homework;

/**
 * 3.声明一个Seasons枚举类，其中有春夏秋冬四个季节，
 * 有一个Print接口，里面有一个public String getSeason()抽象方法，
 * 让Seasons枚举类实现这个接口，实现方法用来返回四季，在main中打遍历打印出四季。
 */
public class Test03 {
    public static void main(String[] args) {
        Seasons[] values = Seasons.values();
        for (Seasons arr:values){
            System.out.println(arr.getSEASON());
        }
    }
}
enum Seasons implements Print {
    SPRING("春天"){
        @Override
        public String getSeason() {
            return SPRING.SEASON;
        }
    },SUMMER("夏天"){
        @Override
        public String getSeason() {
            return SUMMER.SEASON;
        }
    },AUTUMN("秋天"){
        @Override
        public String getSeason() {
            return AUTUMN.SEASON;
        }
    },WINTER("冬天"){
        @Override
        public String getSeason() {
            return WINTER.SEASON;
        }
    };
    private final String SEASON;

    Seasons(String SEASON) {
        this.SEASON = SEASON;
    }

    public String getSEASON() {
        return SEASON;
    }
}
interface Print {
    public String getSeason();
}